<script setup lang="ts">
type MyObj = {
  a: number
  b: string
  c?: boolean
  d?: null
}
// type RequiredMyObj = Required<MyObj> //变必填
// type PartialMyObj = Partial<MyObj> //变可选

// 类似源码
type MyRequired<T> = {
  [Z in keyof T]-?: T[Z]
}
type RequiredMyObj = MyRequired<MyObj> //变必填

type MyPartial<T> = {
  [H in keyof T]?: T[H]
}
type PartialMyObj = MyPartial<MyObj> //变可选
</script>

<template>
  <div class="playground-page">
    <h1>playground</h1>
  </div>
</template>

<style scoped lang="scss"></style>
